<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title></title>
    <link rel="stylesheet" href="../../build/aui-css/css/bootstrap.css">
    <script src="../../build/aui/aui.js"></script>
    <style>
    body {
        margin: 20px;
    }
    iframe {
        border: 5px solid lightblue;
    }
    </style>
</head>
<body>
    <h1>AlloyUI - Autosize iframe</h1>
    <iframe frameborder="0" border="0" scrolling="no" src="assets/short.html" width="100%" id="iframe"></iframe></div></div>
    <button id="long" class="btn">Load long url</button>
    <button id="short" class="btn">Load short url</button>
    <script>
    YUI({ filter: 'raw' }).use('aui-autosize-iframe', function(Y) {

        var iframe = Y.one('#iframe');

        iframe.plug(Y.Plugin.AutosizeIframe);

        Y.one('#long').on('click', function() {
            iframe.set('src', 'assets/long.html');
        });
        Y.one('#short').on('click', function() {
            iframe.set('src', 'assets/short.html');
        });

    });
    </script>
</body>
</html>